window.onload = function () {
    var btnLogin = document.getElementById('btnLogin');
    btnLogin.onclick = btnLoginClick;
}


function btnLoginClick() {
    var username = document.getElementById('username').value;
    var password=document.getElementById('password').value;
    if(username=='admin'&&password=='123'){
         location.href = "index.html"; // BOM : Browser Object Model
    }else{
        alert("登录失败");
    }
}